package com.example.demoexcel.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.CellExtra;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.fastjson.JSON;
import com.example.demoexcel.model.AreaStationData;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @author 赵恒
 * @date 2023/7/11
 */
@Slf4j
public class AreaStationDataListener implements ReadListener<AreaStationData> {
    @Override
    public void onException(Exception e, AnalysisContext analysisContext) throws Exception {

    }

    @Override
    public void invokeHead(Map<Integer, CellData> map, AnalysisContext analysisContext) {

    }

    @Override
    public void invoke(AreaStationData areaStationData, AnalysisContext analysisContext) {
        log.info("areaStationData:{}", JSON.toJSONString(areaStationData));
    }

    @Override
    public void extra(CellExtra cellExtra, AnalysisContext analysisContext) {

    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    @Override
    public boolean hasNext(AnalysisContext analysisContext) {
        return false;
    }
}
